package app.controller;

import java.io.IOException;

import javax.servlet.ServletException;

import org.rails.core.web.Action;
import org.rails.core.web.ControllerBase;
import org.rails.extjs.ExtJS;
import org.rails.extjs.javascript.JavaScript;
import org.rails.extjs.messagebox.MessageBox;

public class TestController extends ControllerBase {

	public TestController(Action action) throws Exception {
		super(action);
	}
	
	public void indexAction() throws IOException, ServletException{
		
//		JavaScript js = MessageBox.confirm("title","确定吗",new JavaScript("alert('ok');"), new JavaScript("alert('no');"), null);
//		ExtJS.bind(request, js);
//		
//		js = MessageBox.prompt("title","msg",new JavaScript("alert('ok');"), new JavaScript("alert('no');"), null, 200, "8888888");
//		ExtJS.bind(request, js);
		
		MessageBox box = new MessageBox(MessageBox.ICON_ERROR,MessageBox.BUTTON_YES_NO_CANCEL, "title", "msg");
		ExtJS.bind(request, box);
		
		action.render();
	}

}
